<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
    <script src="js/axios.min.js"></script>
</head>
<body>
    <div id="app">
        <input type="text" placeholder="请输入部门编号" v-model="deptno">
        <button @click="removeDept">删除部门</button>
    </div>
</body>
</html>
<script>
    var vm=new Vue({
        el:'#app',
        data:{
            deptno:'',
            url:'http://localhost:8080/depts'
        },
        methods: {
            removeDept(){
                axios({
                    url:this.url,
                    method:'DELETE',
                    data:{
                        deptno:this.deptno
                    }
                }).then(res=>{
                    console.log(res);
                });
            }
        },
    });
</script>